/**
 * Created by huzhihui on 2017/9/18.
 */
import React from "react";
import {connect} from "dva";
import styles from "./index.css";

class Introduction extends React.Component {

    componentDidMount() {
        this.getHtml();
    }

    getHtml() {
        const {dispatch} = this.props;
        dispatch({
            type: 'api/updateDefaultSelectedKeys',
            payload: ['1'],
        });
        ;
        dispatch({
            type: 'introduction/getIntroductionHtml'
        });
    }

    render() {
        const {introductionHtml} = this.props;
        return (
            <div>
                <h2>
                    <a href="#base" className={styles.base}>基本介绍</a>
                </h2>
                <div dangerouslySetInnerHTML={{__html: introductionHtml}}/>
                <div>

                </div>
            </div>
        )

    }
}

export default connect(({introduction: {introductionHtml}}) => ({
    introductionHtml
}))(Introduction);